/**
 * 
 */
package de.wesemann.mediahandbook.le.adapter;

import java.util.List;

import android.app.Activity;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import de.wesemann.mediahandbook.le.R;

/**
 * @author Lars W.
 * 
 */
public class CompanyDetailAdapter extends ArrayAdapter<String> {

	private List<String> mValues;

	public CompanyDetailAdapter(Activity context, List<String> keys,
			List<String> values) {
		super(context, R.layout.company_detail_row, values);
		this.mValues = values;
	}

	static class ViewHolder {
		public TextView district;
	}

	@Override
	public int getCount() {
		return mValues.size();
	}

	@Override
	public String getItem(int position) {
		return mValues.get(position);
	}

	@Override
	public long getItemId(int position) {
		return mValues.get(position).hashCode();
	}

//	public View getView(int position, View convertView, ViewGroup parent) {
//		ViewHolder holder;
//
//		if (convertView == null) {
//			LayoutInflater vi = mContext.getLayoutInflater();
//			convertView = vi.inflate(R.layout.firm_row, null, true);
//
//			holder = new ViewHolder();
//			if (mKeys.contains(mContext.getString(R.string.branch))) {
//				holder.brach = (TextView) convertView
//						.findViewById(R.id.tv_firmname);
//			}
//			holder.firmStreet = (TextView) convertView
//					.findViewById(R.id.tv_firm_street);
//			holder.firmCity = (TextView) convertView
//					.findViewById(R.id.tv_firm_city);
//			convertView.setTag(holder);
//		} else {
//			holder = (ViewHolder) convertView.getTag();
//		}
//		MediahandbookCompany comp = items.get(position);
//		holder.firmName.setText(comp.getName());
//		String houseAdditional = "";
//		if (comp.getHousenumber_additional() != null) {
//			houseAdditional = comp.getHousenumber_additional();
//		}
//		holder.firmStreet.setText(comp.getStreet() + " "
//				+ comp.getHousenumber() + " " + houseAdditional);
//		holder.firmCity.setText(comp.getPostcode() + " " + comp.getCity());
//		return convertView;
//	}

	/**
	 * if (!branch.isEmpty()) { columns.add(getString(R.string.branch));
	 * companyDetails.add(branch.get(0).getName()); } if
	 * (mCompany.getMain_activity() != null) {
	 * columns.add(getString(R.string.company_main_activity));
	 * companyDetails.add(mCompany.getMain_activity()); } if
	 * (mCompany.getProducts() != null) {
	 * columns.add(getString(R.string.company_products));
	 * companyDetails.add(mCompany.getProducts()); } if (mCompany.getResources()
	 * != null) { columns.add(getString(R.string.company_resources));
	 * companyDetails.add(mCompany.getResources()); } if
	 * (mCompany.getPast_customers() != null) {
	 * columns.add(getString(R.string.company_past_costumers));
	 * companyDetails.add(mCompany.getPast_customers()); }
	 * columns.add(getString(R.string.company_district));
	 * companyDetails.add(getDistrictName(mCompany.getStreet(),
	 * Integer.toString(mCompany.getHousenumber())));
	 */
}
